﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="CreateDesignTimeAbstractNode" Bound="false"  xmlns="http://schemas.microsoft.com/pag/gax-core" xmlns:xi="http://www.w3.org/2001/XInclude">
  <DocumentationLinks>
    <Link Kind="Documentation" Caption="How To: Create a Design-Time Base Node" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.EntLib.2007Apr/EnterpriseLibrary/html/10-140-How_To_Create_a_DesignTime_Base_Node.htm" />
    <Link Kind="NextStep" Caption="Create Design-Time Provider Node" Url="recipe://CreateDesignTimeNode" />
  </DocumentationLinks>
  <xi:include href="../Common/CommonTypeAliases.xml"
      xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>Create Design-Time Base Provider Node</Caption>
  <Description>Creates a design-time base node for an existing runtime provider base type in a custom application block.</Description>
	<xi:include href="../Common/CommonCreateDesignTimeNoder.xml"
      xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Recipe/gax:HostData)" />
	<Arguments>
		<xi:include href="../Common/CommonCreateDesignTimeNoder.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Recipe/gax:Arguments/gax:Argument)" />
		<Argument Name="BaseNodeName">
			<ValueProvider Type="Evaluator" Expression="Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ConfigurationNode"/>
		</Argument>
		<Argument Name="AbstractNode" Type="System.Boolean">
			<ValueProvider Type="Evaluator" Expression="true" />
		</Argument>
		<Argument Name="PolymorphicConfigurationTypeName" >
			<ValueProvider Type="Evaluator" Expression="NameTypeConfigurationElement" />
		</Argument>
		<Argument Name="ApplicationBlockSettingsBuilder" Type="ProjectItem">
			<ValueProvider Type="ProjectItemByFullNameProvider" 
                     ProjectArgumentName="DesignProject" 
                     ItemFullName="ApplicationBlockSettingsBuilder.$LanguageFileExtension$"
											/>
		</Argument>
		<Argument Name="ApplicationBlockSettingsNodeBuilder" Type="ProjectItem">
			<ValueProvider Type="ProjectItemByFullNameProvider" 
                     ProjectArgumentName="DesignProject" 
                     ItemFullName="ApplicationBlockSettingsNodeBuilder.$LanguageFileExtension$" 
										 />
		</Argument>
		<Argument Name="ProviderName">
			<ValueProvider ConfigurationType="RuntimeConfigurationItem" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.ValueProviders.Nodes.ProviderNameValueProvider, Microsoft.Practices.EnterpriseLibrary.BlockFactory" >
				<MonitorArgument Name="RuntimeConfigurationItem" />
			</ValueProvider>
		</Argument>
    <Argument Name="RuntimeCustomConfigurationItem" Type="System.Type" Required="false" >
      <ValueProvider Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.ValueProviders.Providers.CustomConfigurationClassValueProvider, Microsoft.Practices.EnterpriseLibrary.BlockFactory"
                CustomConfigurationType="RuntimeConfigurationItem"
                CustomConfigurationPrefix="Custom"
											>
        <MonitorArgument Name="RuntimeConfigurationItem" />
      </ValueProvider>
    </Argument>
    <Argument Name="ParentUINodeProjectItem" Type="System.Type">
      <ValueProvider Type="TypeValueProvider" TypeFullNameExpression="$Namespace$.ApplicationBlockSettingsNode" UseProjectItemWrapper="true" />
    </Argument>
    <Argument Name="ParentUINodeName" >
      <ValueProvider Type="ArgumentExpressionProvider" Expression="$ParentUINodeProjectItem.FullName$">
        <MonitorArgument Name="ParentUINodeProjectItem" />
      </ValueProvider>
    </Argument>
  </Arguments>
	<GatheringServiceData>
		<Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
			<Pages>
				<Page>
					<Title>Design-Time Node</Title>
					<LinkTitle>Design-Time Node</LinkTitle>
					<Help></Help>
					<Fields>
						<Field Label="Node Name" ValueName="NodeName" >
							<Tooltip>Specifies the name for the node</Tooltip>
						</Field>
            <Field ValueName="RuntimeConfigurationItem" Label="Runtime Configuration Type">
              <Tooltip>Specifies the configuration object for the design time</Tooltip>
              <Editor Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Editors.TypeBrowser, Microsoft.Practices.EnterpriseLibrary.BlockFactory" 
											Filter="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Editors.ConfigurationTypeFilter, Microsoft.Practices.EnterpriseLibrary.BlockFactory" />
            </Field>
            <Field ValueName="RuntimeCustomConfigurationItem" Label="Custom Configuration Type">
              <Tooltip>Specifies the custom configuration object for the design time</Tooltip>
              <Editor Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Editors.TypeBrowser, Microsoft.Practices.EnterpriseLibrary.BlockFactory" 
											Filter="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Editors.ConfigurationTypeFilter, Microsoft.Practices.EnterpriseLibrary.BlockFactory" />
            </Field>
            <Field ValueName="ParentUINodeProjectItem" Label="Parent UI Custom Node">
              <Tooltip>Specifies the parent node for the new custom node in the UI</Tooltip>
              <Editor Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Editors.TypeBrowser, Microsoft.Practices.EnterpriseLibrary.BlockFactory" 
											Filter="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Editors.NodeTypeFilter, Microsoft.Practices.EnterpriseLibrary.BlockFactory" 
										  UseProjectItemWrapper="true"
											/>
            </Field>
        </Fields>
				</Page>
				<Page Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.CustomPages.DesignTimePropertiesPage, Microsoft.Practices.EnterpriseLibrary.BlockFactory" Width="800" Height="500">
					<Title>Design-Time Node Properties</Title>
					<LinkTitle>Design-Time Node Properties</LinkTitle>
					<Help></Help>
				</Page>
			</Pages>
		</Wizard>
	</GatheringServiceData>
	<Actions>
		<Action Name="CreateDesignTimeNodeInfo" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.CreateDesignTimeNodeInfo, Microsoft.Practices.EnterpriseLibrary.BlockFactory"
            >
			<Input Name="DesignTimeProperties" RecipeArgument="PropertiesInfo"/>
			<Input Name="NodeName" RecipeArgument="NodeName"/>
      <Input Name="RuntimeConfigurationType" RecipeArgument="RuntimeConfigurationItem"/>
      <Input Name="BaseNodeName" RecipeArgument="BaseNodeName"/>
			<Input Name="Namespace" RecipeArgument="Namespace"/>
			<Input Name="AbstractNode" RecipeArgument="AbstractNode"/>
			<Input Name="ParentUINodeName" RecipeArgument="ParentUINodeName"/>
			<Input Name="ProviderName" RecipeArgument="ProviderName"/>
			<Input Name="PolymorphicConfigurationTypeName" RecipeArgument="PolymorphicConfigurationTypeName"/>
      <Output Name="DesignTimeNodeInfo"/>
    </Action>
    <Action Name="CreateCustomDesignTimeNodeInfo" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.CreateDesignTimeNodeInfo, Microsoft.Practices.EnterpriseLibrary.BlockFactory"
            NodeName="Custom$NodeName$"
            BaseNodeName="$NodeName$"
            CustomConfigurationTypeDefined="true"
            >
      <Input Name="DesignTimeProperties" RecipeArgument="PropertiesInfo"/>
      <Input Name="RuntimeConfigurationType" RecipeArgument="RuntimeCustomConfigurationItem"/>
      <Input Name="Namespace" RecipeArgument="Namespace"/>
      <Input Name="AbstractNode" RecipeArgument="AbstractNode"/>
      <Input Name="ParentUINodeName" RecipeArgument="ParentUINodeName"/>
      <Input Name="ProviderName" RecipeArgument="ProviderName"/>
      <Input Name="PolymorphicConfigurationTypeName" RecipeArgument="PolymorphicConfigurationTypeName"/>
      <Output Name="DesignTimeNodeInfo"/>
      <Output Name="CustomConfigurationTypeDefined"/>
    </Action>
    <xi:include href="../Common/CommonCreateDesignTimeNoder.xml"
						xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Recipe/gax:Actions/gax:Action)" />
    
    <Action Name="GenerateCustomNodeContent" 
           Type="TextTemplateAction"
           Template="$TextTemplateBaseDirectory$CustomDesignTimeNode.t4">
      <Input Name="ProcessTemplate" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input Name="DesignTimeNodeInfo" ActionOutput="CreateCustomDesignTimeNodeInfo.DesignTimeNodeInfo"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddCustomNode" 
			  Type="AddItemFromStringActionPromptingExistence" 
			  Open="true"  PromptForOverwriting="true" 
				TargetFileName="Custom$NodeName$.$LanguageFileExtension$"
				>
      <Input Name="AddItem" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input Name="Content" ActionOutput="GenerateCustomNodeContent.Content" />
      <Input Name="Project" RecipeArgument="DesignProject" />
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="GenerateBuilderMethodContent" Type="TextTemplateAction"
		Template="$TextTemplateBaseDirectory$DesignTimeBuilders\BuilderMethod.t4">
			<Input	Name="DesignTimeNodeInfo" ActionOutput="CreateDesignTimeNodeInfo.DesignTimeNodeInfo"/>
			<Output Name="Content" />
		</Action>
		<Action Name="AddBuilderMethod" Type="AddItemFromStringActionPromptingExistence" PromptForOverwriting="true" ItemName="ApplicationBlockSettingsBuilder.$LanguageFileExtension$"
						TargetFileName="ApplicationBlockSettingsBuilder.$NodeName$.$LanguageFileExtension$"	>
			<Input	Name="Content" ActionOutput="GenerateBuilderMethodContent.Content" />
			<Input	Name="Project" RecipeArgument="DesignProject" />
			<Output Name="ProjectItem"/>
			<Output Name="CancelByTheUser"/>
		</Action>
		<Action Name="GenerateNodeBuilderMethodContent" Type="TextTemplateAction"
		Template="$TextTemplateBaseDirectory$DesignTimeBuilders\NodeBuilderMethod.t4">
			<Input	Name="DesignTimeNodeInfo" ActionOutput="CreateDesignTimeNodeInfo.DesignTimeNodeInfo"/>
			<Output Name="Content" />
		</Action>
		<Action Name="AddNodeBuilderMethod" Type="AddItemFromStringActionPromptingExistence" PromptForOverwriting="true" ItemName="ApplicationBlockSettingsNodeBuilder.$LanguageFileExtension$"
						TargetFileName="ApplicationBlockSettingsNodeBuilder.$NodeName$.$LanguageFileExtension$"	>
			<Input	Name="Content" ActionOutput="GenerateNodeBuilderMethodContent.Content" />
			<Input	Name="Project" RecipeArgument="DesignProject" />
			<Output Name="ProjectItem"/>
			<Output Name="CancelByTheUser"/>
		</Action>
		<Action Name="GenerateBuilderRegisterMethodContent" Type="TextTemplateAction"
		Template="$TextTemplateBaseDirectory$DesignTimeBuilders\BuilderRegisterMethod.t4">
			<Input	Name="DesignTimeNodeInfo" ActionOutput="CreateDesignTimeNodeInfo.DesignTimeNodeInfo"/>
			<Output Name="Content" />
		</Action>
		<Action Name="UpdateApplicationBlockSettingsBuilder" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.UpdateCodeFunction, Microsoft.Practices.EnterpriseLibrary.BlockFactory" MethodName="BuildProviders">
			<Input Name="ProjectItem"			RecipeArgument="ApplicationBlockSettingsBuilder"/>
			<Input Name="CancelByTheUser" ActionOutput="AddBuilderMethod.CancelByTheUser"/>
			<Input Name="MethodContent" ActionOutput="GenerateBuilderRegisterMethodContent.Content"/>
		</Action>
		<Action Name="GenerateNodeBuilderRegisterMethodContent" Type="TextTemplateAction"
		Template="$TextTemplateBaseDirectory$DesignTimeBuilders\NodeBuilderRegisterMethod.t4">
			<Input	Name="DesignTimeNodeInfo" ActionOutput="CreateDesignTimeNodeInfo.DesignTimeNodeInfo"/>
			<Output Name="Content" />
		</Action>
		<Action Name="UpdateApplicationBlockSettingsNodeBuilder" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.UpdateCodeFunction, Microsoft.Practices.EnterpriseLibrary.BlockFactory" MethodName="BuildProviders">
			<Input Name="ProjectItem"			RecipeArgument="ApplicationBlockSettingsNodeBuilder"/>
			<Input Name="CancelByTheUser" ActionOutput="AddNodeBuilderMethod.CancelByTheUser"/>
			<Input Name="MethodContent" ActionOutput="GenerateNodeBuilderRegisterMethodContent.Content"/>
		</Action>
    <Action Name="AddCustomNodeNameResource" Type="AddResource"  
        ResourceName="Custom$NodeName$Name" 
        ResourceValue="Custom$NodeName$"
        RunCustomTool="true"
            >
      <Input Name="Resources" RecipeArgument="Resources" />
    </Action>


    <Action Name="AddCustomResources" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.AddResourcesFromDesignTimeNodeInfo, Microsoft.Practices.EnterpriseLibrary.BlockFactory"
            DescriptionSuffix="Description">
      <Input Name="NodeInfo" ActionOutput="CreateCustomDesignTimeNodeInfo.DesignTimeNodeInfo"/>
      <Input Name="Resources" RecipeArgument="Resources"/>
    </Action>
    <Action Name="GenerateCustomRegistrarRegisterContent" 
	       Type="TextTemplateAction"
	       Template="$TextTemplateBaseDirectory$RegistrarRegister.t4">
      <Input Name="ProcessTemplate" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input Name="DesignTimeNodeInfo" ActionOutput="CreateCustomDesignTimeNodeInfo.DesignTimeNodeInfo"/>
      <Output Name="Content" />
    </Action>
    <Action Name="GenerateCustomMapRegistrarRegisterContent" 
       Type="TextTemplateAction"
       Template="$TextTemplateBaseDirectory$MapRegistrarRegister.t4">
      <Input Name="ProcessTemplate" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input Name="DesignTimeNodeInfo" ActionOutput="CreateCustomDesignTimeNodeInfo.DesignTimeNodeInfo"/>
      <Output Name="Content" />
    </Action>
    <Action Name="GenerateCustomRegistrarMethodsContent" 
       Type="TextTemplateAction"
       Template="$TextTemplateBaseDirectory$RegistrarMethods.t4">
      <Input Name="ProcessTemplate" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input Name="DesignTimeNodeInfo" ActionOutput="CreateCustomDesignTimeNodeInfo.DesignTimeNodeInfo"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddCustomRegistrarMethods" Type="AddItemFromStringActionPromptingExistence" PromptForOverwriting="true" ItemName="CommandRegistrar.$LanguageFileExtension$"
						TargetFileName="CommandRegistrar.Custom$NodeName$.$LanguageFileExtension$"	>
      <Input Name="AddItem" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input	Name="Content" ActionOutput="GenerateCustomRegistrarMethodsContent.Content" />
      <Input	Name="Project" RecipeArgument="DesignProject" />
      <Output Name="ProjectItem"/>
      <Output Name="CancelByTheUser"/>
    </Action>
    <Action Name="UpdateCustomRegistrar" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.UpdateRegistrar, Microsoft.Practices.EnterpriseLibrary.BlockFactory" MethodName="Register">
      <Input Name="UpdateCodeFunctionCondition" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input Name="DesignTimeNodeInfo" ActionOutput="CreateCustomDesignTimeNodeInfo.DesignTimeNodeInfo"/>
      <Input Name="ProjectItem"			RecipeArgument="Registrar"/>
      <Input Name="MethodContent" ActionOutput="GenerateCustomRegistrarRegisterContent.Content"/>
      <Input Name="CancelByTheUser" ActionOutput="AddRegistrarMethods.CancelByTheUser"/>
    </Action>
    <Action Name="UpdateCustomMapRegistrar" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.UpdateRegistrar, Microsoft.Practices.EnterpriseLibrary.BlockFactory" MethodName="Register">
      <Input Name="UpdateCodeFunctionCondition" ActionOutput="CreateCustomDesignTimeNodeInfo.CustomConfigurationTypeDefined" />
      <Input Name="DesignTimeNodeInfo" ActionOutput="CreateCustomDesignTimeNodeInfo.DesignTimeNodeInfo"/>
      <Input Name="ProjectItem"			RecipeArgument="MapRegistrar"/>
      <Input Name="MethodContent" ActionOutput="GenerateCustomMapRegistrarRegisterContent.Content"/>
      <Input Name="CancelByTheUser" ActionOutput="AddRegistrarMethods.CancelByTheUser"/>
    </Action>

  </Actions>
</Recipe>
